﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Copa_do_Mundo_2014
{
    public partial class InfoReservar : Form
    {

        String[,] compras;
        String jogos;
        int i,aux;

        public InfoReservar(String[,] compras, String c)
        {
            this.compras = compras;
            jogos = c;
            InitializeComponent();
            for (i = 99; i >=0; i--)
            {
                if (compras[i, 0] == null)
                {
                    aux = i;
                }
            }
            txtcod.Text = Convert.ToString(aux);
            txtjogos.Text = jogos;
        }

        private void InfoReservar_Load(object sender, EventArgs e)
        {

        }

        private void InfoReservar_FormClosing(object sender, FormClosingEventArgs e)
        {
            Application.Exit();
        }

        private void btnfechar_Click(object sender, EventArgs e)
        {
            


            compras[aux, 0] = txtnome.Text;
            compras[aux, 1] = txtrg.Text;
            compras[aux, 2] = jogos;
            compras[aux, 3] = txtcod.Text;
            Principal principal = new Principal(compras);
            principal.Show();
            this.Hide();
        }

        private void btnvoltar_Click(object sender, EventArgs e)
        {
            Reservar reservar = new Reservar(compras);
            reservar.Show();
            this.Hide();
        }


    }
}
  